var post_show_ops={
    init:function(){
        this.eventBind();
    },
    eventBind:function(){
        $('#exampleModal').on('show.bs.modal', function (event) {
            $("#modalDialog").draggable();
            var button = $(event.relatedTarget) // Button that triggered the modal
            var recipient = button.data('whatever') // Extract info from data-* attributes
            var name=button.data('name');
            // If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
            // Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
            var modal = $(this);
            modal.find('.modal-body input:hidden[name=pid]').val(recipient);
            modal.find('.modal-title').text('回复 ' + name +' 的评论')
        });


        $('#submit-btn').click(function(){
            $('.modal-body>form').submit();
        })
    }
};

$(document).ready(function(){

    post_show_ops.init();
});